package com.supplychain.financial.parent.common.util;

import java.util.UUID;

public class StringUtils {
	/**
	 * 驼峰格式字符串转换为指定格式分割字符串
	 * @param str  要分隔的驼峰格式字符串
	 * @param partition 分割符
	 * @return 分割好的字符串
	 */
    public static String humpToPartition(String str,String partition) {
        if (str == null || "".equals(str.trim())) {
            return null;
        }
        int len = str.length();
        StringBuilder sb = new StringBuilder(len);
        for (int i = 0; i < len; i++) {
            char c = str.charAt(i);
            if (Character.isUpperCase(c)) {
                sb.append(partition);
                sb.append(Character.toLowerCase(c));
            } else {
                sb.append(c);
            }
        }
        return sb.toString();
    }
    
    public static boolean isNullOrEmpty(Object o){
    	return o == null || "".equals(o);
    }

    public static boolean isNullOrTrimEmpty(String o){
        return o == null || "".equals(o.trim());
    }

    public static boolean isNot_NullOrTrimEmpty(String o){
        return !isNullOrTrimEmpty(o);
    }
    
    
    public static String getUUID() {
        return UUID.randomUUID().toString().replace("-", "").toUpperCase();
    }


}
